﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WorkOrder.Business;

namespace WorkOrder
{
    public partial class taskReportList : System.Web.UI.Page
    {
        #region 处理光标行颜色事件
        protected void gvReport_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowIndex >= 0)
            {
                e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor,this.style.background='#ffe3a0'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
            }
        }
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["UserID"] == null || Session["UserID"].ToString() == "")
            //{
            //    Session.Clear();
            //    ClientScript.RegisterClientScriptBlock(this.GetType(), "windowhref", "<script type='text/javascript'>alert('对不起，您还没有登录系统！');window.parent.location.href='../login.aspx';</script>");
            //}
            string startTime = Request.Params["f"];
            string endTime = Request.Params["t"];
            string order_type = Request.Params["o"];        //工单类型,开通单,调整单,取消单A总计,B平均历时
            string product = Request.Params["p"];            //产品类型,语音专线,数据专线......,C每一列的总计
            string isTimeout = Request.Params["j"];           //是否及时单,0否,1是,2总量,3平均历时
            string timeoutValue = Request.Params["v"];    //超时计算的标准值
            string hasEnig = Request.Params["e"];             //是否有工程,0否,1是,2总量,3平均历时
            if (!string.IsNullOrEmpty(startTime) && !string.IsNullOrEmpty(endTime))
            {
                TaskReport tr = new TaskReport();
                GridView1.DataSource = tr.getOrderList(startTime, endTime, order_type, product, isTimeout, timeoutValue, hasEnig);
                GridView1.DataBind();
            }
        }
    }
}
